<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<?php
require_once '../model/db.php';
require_once '../model/keyword.php';
require_once '../model/works.php';

//$keywords = new Keywords();
//echo "Key_word" . "<br> <br>";
//$list_keyword = $keywords->selectLen();

$works = new works();
echo "Works" . "<br> <br>";
//$list_works = $works->selectLenW();
?>
<?php
if (!isset($_GET["page"]))
    $page = 1;
else
    $page = $_GET["page"];
$list_works = $works->selectW($page);
$total = $works->countW();
?>

<?php for ($i = 1; $i <= $total / PAGE; $i++): ?>
    <a href="index.php?page=<?php echo $i ?>">
        <?php echo $i ?>
    </a>
<?php endfor; ?>

<?php
foreach ($works as $temp):
    echo $temp["id"] . ": ";
    echo $temp["name"] . "<br>";
endforeach;
?>

<?php for ($i = 1; $i <= $total / PAGE; $i++): ?>
    <a href="index.php?page=<?php echo $i ?>">
        <?php echo $i ?>
    </a>
<?php endfor; ?>
